home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / applic / ntp / doc / dts3.txt.Z / dts3.txt
Encoding:
Text File  |  1991-09-29  |  44.7 KB  |  856 lines

  1. @TITLE = A Comparison of Certain Timekeeping Systems and the Network
  2. Time Protocol<$FSponsored by: Defense Advanced Research Projects Agency
  3. under NASA Ames Research Center contract number NAG 2-638 and National
  4. Science Foundation grant number NCR-89-13623.>
  5.  
  6. @AUTHOR = David L. Mills
  7. Electrical Engineering Department
  8. University of Delaware
  9. 25 March 1991
  10.  
  11. @AUTHOR = Abstract
  12.  
  13. @ABSTRACT = This document describes and compares three timekeeping
  14. systems in objectives, architecture and design. These systems are:
  15. Digital Time Synchronization Service (DTSS), Probabilistic Clock
  16. Synchronization (PCS) and Network Time Protocol (NTP), which have been
  17. submitted to the standards bodies as the basis of an international
  18. standard. Each of the three can be used to synchronize local clocks in a
  19. computer network with distributed and diversified services.
  20.  
  21. Author's note: This document is a preliminary draft and is subject to
  22. change before publication in final form. It is intended for
  23. informational purposes and used only in connection with professional
  24. activities. Please do not cite this document in any publication and do
  25. not redistribute it without this notice.
  26.  
  27. @HEAD LEVEL 1 =  Introduction
  28.  
  29. This report discusses the scope, application and function of three
  30. network time-synchronization architectures and protocols with respect to
  31. possible standards activities. These include the Distributed Time
  32. Synchronization Service (DTSS) described in [DEC89], the Probabilistic
  33. Clock Synchronization (PCS) described in [CRI89b] and the Network Time
  34. Protocol (NTP) described in [MIL90b]. A document [ISO90] has been
  35. submitted to the ISO Working Group JTC1/SC21/WG7 proposing DTSS for
  36. consideration. Another document [CCI90] has been submitted to the CCITT
  37. Study Group VII proposing NTP for consideration. In addition, it is
  38. expected that PCS will also become a candidate for consideration. It may
  39. be that one of these three architectures will eventually be selected for
  40. ISO/CCITT standardization or some other architecture synthesized from
  41. one or more of them.
  42.  
  43. In most developed nations time is considered a metricated, civil
  44. constant, disseminated by national means, coordinated by international
  45. agreement and intended for ubiquitous, free access. Today, the
  46. timekeeing systems of most countries are coordinated with Coordinated
  47. Universal Time (UTC), which is maintained by cooperative agreement using
  48. astronomical observations. Users of computer network applications expect
  49. local clocks to be synchronous with UTC with acceptable accuracy,
  50. stability and reliability.
  51.  
  52. As will be evident from later discussion, there are wide variations in
  53. the perceived requirements and expectations of the three timekeeping
  54. systems considered in this report; however, each of these systems shares
  55. the common goal of providing accurate, stable and reliable local clocks.
  56. In the following  the accuracy of a clock is how well its time compares
  57. with a designated reference clock or national standard, the stability is
  58. how well it can maintain a constant frequency and the precision is to
  59. what degree time can be resolved in a particular timekeeping system. The
  60. offset of two clocks is the time difference between them, while the skew
  61. is the frequency difference between them. The reliability of a
  62. timekeeping system is the fraction of the time it can be kept operating
  63. and providing correct time with respect to stated stability and accuracy
  64. tolerances.
  65.  
  66. @HEAD LEVEL 1 =  Time Synchronization Systems
  67. An important feature of a computer network providing distributed
  68. services is the capability to synchronize the local clocks of the
  69. various processors in the network. This capability can be provided by a
  70. timekeeping system consisting of time servers (called masters in PCS) in
  71. the form of dedicated or shared processors which exchange timing
  72. messages between themselves and provide timing information to the
  73. clients (called clerks in DTSS and slaves in PCS) of the network
  74. population. Many applications needing time synchronization also need to
  75. coordinate local time with standard time as disseminated from national
  76. standards laboratories via radio, telephone or satellite. This can be
  77. done by connecting some servers to a designated reference clock or
  78. national standard, called a primary clock. The servers connected to
  79. primary clocks are designated primary servers; others that may depend on
  80. them are designated secondary servers. The secondary servers are clients
  81. of the primary servers and may themselves serve a client population
  82. including other secondary servers.
  83.  
  84. It is generally considered impractical to equip every processor with a
  85. primary clock such as a radio timecode receiver or telephone modem;
  86. therefore, a timekeeping system will usually employ one or more primary
  87. clocks and provide synchronization using a synchronization protocol such
  88. as DTSS, PCS or NTP. Using the protocol, servers and clients exchange
  89. timing messages at intervals depending on the accuracy required.
  90. Information in these messages can also used to determine reachability
  91. between the servers and to organize the set of servers and clients as a
  92. hierarchical synchronization subnet. Each client or server selects a set
  93. of servers or peers from within the subnet population on the basis of
  94. accuracy, stability and reliability. In order to assure reliability, at
  95. least three peers operating over disjoint network paths are required. In
  96. some systems the selection of peers is engineered prior to operation;
  97. while, in others, the selection can be automated.
  98.  
  99. Since time is ubiquitous, it may develop that most or all computers in a
  100. network or internet will be members of the synchronization subnet, so
  101. there is some question as to the ability of the synchronization protocol
  102. to scale up in the number of servers and clients in the subnet. There
  103. are of course natural boundaries imposed by administrative, legal and
  104. political constraints and these impose natural boundaries on topology
  105. and reachability. However, there are other boundaries imposed by
  106. technical reasons, such as the quality and utilization of transmission
  107. links, the speed of the processors and so forth.
  108.  
  109. For the highest accuracy it is usually desirable to implant the
  110. synchronization protocol at the lower protocol layers of the reference
  111. model. While the particular layer is not stated in PCS, both DTS and NTP
  112. are implemented at at the transport layer and operated in connectionless
  113. mode. Therefore, the protocol itself must provide protection from lost
  114. or duplicate messages and determine whether its peers are reachable for
  115. the purposes of synchronization. A lightweight association-management
  116. capability, including directory cacheing, dynamic reachability, peer
  117. selection and variable message-interval mechanisms, can be used to
  118. manage state information and reduce resource requirements, as in PCS and
  119. NTP. Optional features may include message authentication based on
  120. crypto-checksums, as in NTP, and provisions for remote management, as in
  121. DTSS and NTP.
  122.  
  123. In typical systems one or more primary servers synchronize directly to
  124. primary clocks, such as timecode receivers (called time providers in
  125. DTSS). Secondary time servers synchronize to the primary servers and
  126. others in the synchronization subnet. A typical subnet is shown in
  127. Figure 1a<$&fig1>, in which the nodes represent subnet servers, with
  128. normal level numbers determined by the hop count to the root, and the
  129. heavy lines the active synchronization paths and direction of timing
  130. information flow. The light lines represent backup synchronization paths
  131. where timing and reachability information is exchanged, but not
  132. necessarily used to synchronize the local clocks. Figure 1b shows the
  133. same subnet, but with the line marked x out of service. The subnet has
  134. re-configured itself automatically to use backup paths, with the result
  135. that one of the servers has dropped from level 2 to level 3.
  136.  
  137. Figure 2<$&fig2> shows the overall organization of a typical
  138. synchronization client, although some architectures do not incorporate
  139. all the components shown. Timestamps exchanged between the client and
  140. possibly several subnet peers are used to determine the offsets between
  141. the client clock and each peer clock, as well as other data necessary to
  142. compute error bounds inherited from the peers and servers along the
  143. synchronization paths to the primary servers.
  144.  
  145. In some systems the data for each peer are processed by the data-filter
  146. algorithm separately to reduce incidental timing noise. The filter
  147. algorithm selects from among the last several samples the one with
  148. presumed minimum error as its output. Then, the peer-selection algorithm
  149. determines from among all peers a suitable subset of peers capable of
  150. providing the most accurate and dependable time. The particular
  151. algorithm used and the rationale for its design are crucial to the
  152. accuracy, stability and reliability of the timekeeping system. Various
  153. systems use either or both of two algorithms, one a version of an
  154. algorithm proposed by Marzullo and Owicki [MAR85] and the other based on
  155. maximum likelihood principles.
  156.  
  157. The selection algorithm provides both a combined clock offset and a
  158. confidence interval over which this offset can be considered valid. In
  159. some systems the combined offset is determined as the midpoint of the
  160. confidence interval, while in others it is computed by a weighted-
  161. average procedure designed to improve accuracy. Finally, the combined
  162. offset is processed by a phase-lock loop (PLL). In the PLL the combined
  163. effects of the filtering, selection and combining operations are to
  164. produce a phase-correction term, which is processed by the loop filter
  165. to control the local clock, which functions as a voltage-controlled
  166. oscillator (VCO). The VCO furnishes the timing (phase) reference to
  167. produce the timestamps used in all timing calculations.
  168.  
  169. The various systems incorporate different PLL models based on
  170. assumptions of the accuracy and stability required. A type-I PLL can
  171. correct for time offset, but not frequency offset; therefore, it
  172. requires periodic corrections depending on the intrinsic frequency
  173. offset and accuracy required. A type-II PLL can correct for both time
  174. and frequency offsets, but requires an initial interval or training in
  175. order to stabilize the frequency-offset data. A type-II PLL can
  176. significantly reduce the message rate and increase the accuracy during
  177. possibly lengthy periods when contact with all servers is lost. However,
  178. real clocks exhibit some degree of instability as the result of aging,
  179. environmental changes, etc., so the improvement in performance using a
  180. type-II PLL is limited. These issues are discussed in further detail in
  181. a later section of this document.
  182.  
  183. Clock offsets are computed using some form of the scheme illustrated in
  184. Figure 3<$&fig3>, shows how timestamps are numbered and exchanged
  185. between peers A and B. Let <$ET sub i>, <$ET sub {i-1}>, <$ET sub {i-
  186. 2}>, <$ET sub {i-3}> be the values of the four most recent timestamps as
  187. shown and let <$Ea~=~T sub {i-2}~-~T sub {i-3}> and <$Eb~=~T sub {i-1}~-
  188. ~T sub i>. Then, the roundtrip delay <$Edelta> and clock offset
  189. <$Etheta> of B relative to A at time <$ET sub i> are:
  190.  
  191. @CENTER = <$Edelta~=~a~-~b~~~~ and ~~~~theta~=~{a~+~b} over 2> .
  192.  
  193. In NTP each message includes the latest three timestamps <$ET sub {i-
  194. 1}>, <$ET sub {i-2}> and <$ET sub {i-3}>, while the fourth timestamp
  195. <$ET sub i> is determined upon arrival of the message. Thus, both peers
  196. can independently calculate delay and offset using a single
  197. bidirectional message stream and cross-check each other, as well as
  198. quickly reconfigure should other servers or network paths fail. Since
  199. the latest timestamps recorded at the server are included in its message
  200. and no more than one message to the same peer can be sent during a
  201. single clock tick, this scheme provides inherent protection against
  202. message loss or duplication.
  203.  
  204. In PCS a request message sent by a client (slave) to a server (master)
  205. includes the <$ET sub {i-3}> timestamp, which is returned by the server
  206. in its reply and used as a unique message identifier in the same way as
  207. NTP. Since a master is expected to reply immediately upon receipt of a
  208. request, the client computes the time offset by simply adding one-half
  209. the measured delay to the master time included in the reply.
  210.  
  211. In DTSS a request message sent by a client (clerk) to a server does not
  212. include the <$ET sub {i-3}> timestamp; however, all DTSS messages
  213. include a 64-bit sequence number (message ID) which can be used to match
  214. replies to requests. A server reply includes the quantity and <$ET sub
  215. {i-1}~-~T sub {i-2}>, which is the interval from when the server
  216. received the request and when it transmitted the reply at <$ET sub {i-
  217. 1}>. While this scheme accommodates cases where a server deliberately
  218. delays its reply, possibly due to congestion or load-balancing, it is
  219. not symmetric and imposes a deliberate hierarchy which may not be
  220. desirable in all cases.
  221.  
  222. In both DTSS, PCS and NTP (version 3) the errors are minimized by the
  223. control-feedback design shown in Figure 2. In practice, errors due to
  224. stochastic network delays usually dominate; however, it is not usually
  225. possible to characterize network delays as a stationary random process,
  226. since network queues can grow and shrink in chaotic fashion and arriving
  227. customer traffic is frequently bursty.
  228.  
  229. Nevertheless, it is a simple exercise to calculate bounds on network
  230. errors as a function of measured delay. The true offset of B relative to
  231. A is called <$Etheta> in Figure 3. Let x denote the actual delay between
  232. the departure of a message from A and its arrival at B. Therefore,
  233. <$Ex~+~theta~=~T sub {i-2}~-~T sub {i-3}~==~a>. Since x must be positive
  234. in our universe, <$Ex~=~a~-~theta~>>=~0>, which requires
  235. <$Etheta~<<=~a>. A similar argument requires that <$Eb~<<=~theta>, so
  236. surely <$Eb~<<=~theta~<<=~a>. This inequality can also be expressed
  237.  
  238. @CENTER = <$Eb~=~{a~+~b} over 2~-~{a~-~b} over 2~<<=~theta~<<=~{a~+~b}
  239. over 2~+~{a~-~b} over 2~=~a> ,
  240.  
  241. which is equivalent to
  242.  
  243. @CENTER = <$Etheta~-~delta over 2~<<=~theta hat~<<=~theta~+~delta over
  244. 2> .
  245.  
  246. In other words, the true clock offset <$Etheta hat> must lie in a
  247. confidence interval of size equal to the measured delay and centered
  248. about the measured offset. This interval is called the inaccuracy
  249. interval in DTSS. In PCS it is used as a filter to discard samples above
  250. a given threshold in order to bound the error.
  251.  
  252. Real systems are subject to stochastic errors due to local clock
  253. resolution and stability. If these errors can be bounded by design and
  254. manufacture to specific tolerances, then it is possible to calculate
  255. their affect on the confidence interval. All three timekeeping systems
  256. include provisions to calculate these bounds as a byproduct of normal
  257. synchronization activities and include their contribution in the
  258. resulting error bounds provided to the user. In DTSS this is done
  259. explicitly as part of the architecture of the clerk-user interface.
  260.  
  261. Since NTP is based on a hierarchical subnet topology, provisions are
  262. necessary to calculate the effects of all errors accumulated on the
  263. synchronization path to the primary clock, including the effect of all
  264. servers, local clocks and the primary clock itself. In addition, one of
  265. the requirements placed on NTP is the ability to calculate not only the
  266. clock offset, but the roundtrip delay and error bound to each peer. This
  267. requirement arises from the perceived user needs to control the
  268. departure of a message to arrive at a peer at a designated time. For
  269. this reason the delay calculation and the error-bound calculation are
  270. kept separate and accumulate separately along the synchronization path
  271. to the primary clock.
  272.  
  273. @HEAD LEVEL 1 =  Issues and Discussion
  274.  
  275. The preceding overview should provide some insight on the architectures,
  276. protocols and algorithms adopted by the DTSS, PCS and NTP timekeeping
  277. systems. However, there are important issues which characterize the
  278. design approach in the three systems which need to be addressed in
  279. further detail. The following sections address some of the most
  280. important of them.
  281.  
  282. @HEAD LEVEL 2 =  Frequency Compensation
  283.  
  284. The NTP local-clock model includes the capability to estimate the
  285. intrinsic frequency of the local oscillator and compensate for its error
  286. with respect to standard time as distributed via the synchronization
  287. subnet. This section contains an overview of the issues and rationale
  288. for the inclusion of this feature. It should be pointed out that nothing
  289. in the NTP local-clock algorithm design precludes its adaptation to
  290. other timekeeping systems.
  291.  
  292. NTP uses a type-II PLL designed to stabilize time and frequency offset
  293. and automatically adjust the message rate and error bounds based on
  294. observed timing noise and clock stability. The various design parameters
  295. were determined using a mathematical model and verified both by
  296. simulation and measurement in several implementations. While not
  297. identified explicitly as such, the PCS self-adjusting, logical-clock
  298. scheme is in fact a type-II PLL. The DTSS design uses a type-I PLL
  299. stating as rationale (private communication) its increased complexity
  300. and vulnerability to mis-implement.
  301.  
  302. An oscillator is characterized by its frequency tolerance and stability.
  303. A tolerance specification is usually in terms of a maximum frequency
  304. deviation with respect to a calibrated source. Typical values range from
  305. 10-5 for an uncompensated quartz-crystal oscillator to 10-12 for a
  306. cesium-beam oscillator. A stability specification is usually in terms of
  307. a maximum frequency change over a specified interval. Typical values
  308. range from 1-7 per day for an quartz oscillator to 10-12 per year for a
  309. cesium oscillator. However, quartz oscillators also exhibit an aging
  310. effect which varies from unit to unit and can result in a long term
  311. gradual frequency change as much as 10-5 per year. In addition, quartz
  312. oscillators without temperature compensation or control exhibit
  313. frequency variations dependent on ambient temperature of about 10-6 per
  314. degree Celsius.
  315.  
  316. The main reason to be concerned about tolerance and stability is the
  317. message rate necessary to keep a local clock within a specified
  318. accuracy. For instance, if a local clock is to be synchronized to within
  319. a millisecond and has an oscillator with a frequency offset of 10-5, it
  320. must be updated at least once every couple of minutes. If this
  321. oscillator is allowed to run for a day without outside correction, it
  322. will be in error by almost a second. On the other hand, if its
  323. particular intrinsic frequency can be estimated and corrected by some
  324. means, the intervals between corrections can be considerably increased.
  325. This feature has considerable practical benefits in cases where servers
  326. dispense time to several hundred clients, as is now the case with many
  327. Internet NTP primary servers.
  328.  
  329. While there are considerable advantages in using frequency estimates,
  330. there are limits imposed by the intrinsic stability of the local-clock
  331. oscillator, which is usually not temperature compensated. Measurements
  332. made with workstations and mainframe computers located in typical office
  333. environments show some oscillators with intrinsic frequency errors over
  334. one second, but with stability after frequency compensation often less
  335. than 10-7 per day; however, these data may vary somewhat between various
  336. equipments and locations. With accurate frequency compensation and
  337. stabilities in this order, message rates can in principle be reduced to
  338. about one in about three hours to maintain millisecond accuracy.
  339.  
  340. In the NTP design considerable attention was paid to the issue of how to
  341. optimize the performance in the face of widely varying tolerance and
  342. stability specifications without requiring specific design configuration
  343. for each individual oscillator. The particular design adopted, called an
  344. adaptive-parameter, type-II, phase-lock loop (PLL) has the capability to
  345. automatically sense the in-operation stability regime of the local
  346. oscillator and then adjust the PLL characteristics (bandwidth) and
  347. message intervals accordingly. The design has been tested using many
  348. types of equipment using compensated and uncompensated quartz
  349. oscillators, as well as cesium oscillators.
  350.  
  351. @HEAD LEVEL 2 =  Reliability
  352.  
  353. One thing learned while developing timekeeping technology is the
  354. overwhelming importance of reliability. Many papers and articles have
  355. been written on this issue with profound theoretical and practical
  356. implications. Typical methods are based on the availability of a number
  357. of peers, together with an algorithm that seeks a subset of greater than
  358. half of them which satisfy some convergence criterion.
  359.  
  360. For the purposes of this discussion, the reliability of the timekeeping
  361. system refers to its ability to sustain peer connectivity and
  362. synchronization in the face of service interruptions on the servers or
  363. links between them. Both DTSS, PCS and NTP explicitly address this point
  364. using the principles of redundancy and diversity. A highly redundant
  365. system employs multiple servers at each level of the hierarchy, while a
  366. highly diverse system employs multiple disjoint peer paths with few
  367. common points of failure. Experience in the Internet shows that these
  368. features are necessary and vital in order to provide reliable and
  369. trustable time.
  370.  
  371. However, along with the issues of redundancy and diversity go the issues
  372. of how to make efficient use of the multiple assets required and here
  373. the proposed systems differ somewhat. In the DTSS model timekeeping
  374. service clients on a LAN or extended LAN send periodic requests to a
  375. subset of a set of time servers registered in a well-known directory
  376. service, selecting the members of the subset at random for each round.
  377. Local time servers periodically exchange timing information with each
  378. other and, optionally, with global time servers presumably in an
  379. extended WAN. If all local servers are lost, a clerk can directly poll a
  380. member of a configured global set.
  381.  
  382. In NTP the synchronization subnet peers exchange messages over paths
  383. which are independently configured. This establishes the topology of the
  384. subnet, over which messages are sent continuously, although usually at
  385. relatively long intervals. Using a distance measure based on maximum-
  386. likelihood estimates of roundtrip delay and total error accumulated at
  387. each level of server from the primary reference source, a subset of
  388. presumed accurate and stable peers is selected and their readings
  389. combined on the basis of distance. While the subnet topology must be
  390. engineered on the basis of anticipated physical interconnectivity, the
  391. actual topology formed by the system results in the lowest distance and
  392. thus lowest error at each level.
  393.  
  394. The approach followed in DTSS utilizes an algorithm due to Marzullo and
  395. Owicki, in which an interval called the inaccuracy interval is
  396. associated with the apparent clock value for each peer. The algorithm
  397. strives to find the smallest interval containing the most peers, while
  398. discarding peers whose intervals are disjoint from the intersection.
  399.  
  400. In earlier versions of NTP a probabilistic approach was taken based on
  401. maximum-liklihood methodology familiar in communications systems design.
  402. In simulation studies with the Marzullo algorithm and actual offset data
  403. collected over particularly troublesome Internet paths, the algorithm
  404. proved to be effective, although accuracy suffered considerably. In NTP
  405. Version 3 the Marzullo algorithm is used in tandem with the original
  406. maximum-likelihood algorithm and appears to work exceptionally well.
  407.  
  408. Of concern to the early users of NTP (Kerberos, part of Project Athena
  409. at MIT) was the vulnerability of the timekeeping system to hostile
  410. attack, since incorrect time could result in denial of service
  411. (premature key expiration, for example). An extensive security analysis
  412. by the Privacy and Security Research Group under the auspices of the
  413. Internet Activities Board concluded that it was not possible to secure
  414. NTP against protocol attack other than through use of cryptographic
  415. authentication. This feature was subsequently introduced in NTP and is
  416. now in regular operation for critical and potentially high-risk servers.
  417.  
  418. In principle, cryptographic authentication could be introduced in other
  419. timekeeping systems as well, including DTSS and PCS, either as a
  420. component of the protocol or, preferably as a component that can be used
  421. by any service on request. It would not seem possible to safely deploy a
  422. ubiquitous, multinational, distributed timekeeping system or set of
  423. interoperable timekeeping systems without this feature. It should be
  424. noted that cryptographic techniques are computationally intensive, so
  425. that special care may have to be taken to preserve the accuracy of the
  426. synchronization service.
  427.  
  428. @HEAD LEVEL 2 =  Accuracy Expectations
  429.  
  430. In many, perhaps most, distributed applications requiring synchronized
  431. local clocks, accuracies in the order of seconds are acceptable.
  432. Applications where inconsistent state in the network can be tolerated
  433. for such periods include distributed archiving, electronic mail and so
  434. forth. However, there are many others where accuracies in the order of
  435. milliseconds are required, such as transaction journaling, distributed
  436. software and hardware maintenance, real-time conferencing and long-
  437. baseline scientific experiments. There are a few others where accuracies
  438. in the order of nanoseconds are required, but these applications
  439. typically rely on special-purpose time-transfer networks, usually via
  440. satellite.
  441.  
  442. Probably few would dispute the ranking of various applications in the
  443. order of increasing accuracy requirements, but there may be some
  444. disagreement on where to draw a reasonable line between those that would
  445. be considered feasible using a shared packet-switched medium with
  446. stochastic delays and those that require a dedicated medium with
  447. predictable delays. With today's technology using 10-Mbps LANs
  448. interconnected by 1.5-Mbps WANs, the line might be drawn in the
  449. milliseconds; however, considering the HPCC initiative which could lead
  450. to widespread deployment of 1-Gbps links, the line might be drawn in the
  451. microseconds. It would seem, then, that any timekeeping system intended
  452. for wide deployment should contain provisions to accommodate accuracies
  453. of this order.
  454.  
  455. In general, it is not possible absent a detailed engineering analysis of
  456. each particular scenario to predict the expected accuracy of a
  457. timekeeping system. In principle, both DTSS, PSC and NTP can maintain an
  458. accuracy regime consistent with the underlying resource provisioning.
  459. While no specific examples can be cited for DTSS, experiments with both
  460. PCS and NTP suggest accuracies to a millisecond can be expected for both
  461. protocols when operated over a high speed LAN.
  462. Most users of a distributed timekeeping system are most concerned about
  463. the maximum error that can be displayed, rather than the expected error,
  464. which is usually much smaller. Both DTSS, PCS and NTP include algorithms
  465. designed to avoid malfunctioning servers and provide to the user
  466. confidence bounds which bracket the source of correct time. DTSS does
  467. this by collecting samples from at least three servers, computing the
  468. intersection of their confidence intervals and providing this and its
  469. midpoint to the user. PCS takes a different approach where the user
  470. provides the confidence interval and the protocol discards all samples
  471. with a larger interval.
  472.  
  473. While NTP includes an algorithm similar to DTSS, it also includes a
  474. considerable burden of procedures designed to provide a best-effort
  475. accuracy, even in the face of severe timing noise that normally occurs
  476. as the result of stochastic network delays and congestion. The reason
  477. for this complexity is to serve both communities - those expecting
  478. reliable error bounds, but can tolerate diminished expected accuracy,
  479. and those expecting the highest accuracy attainable under current
  480. environmental conditions.
  481.  
  482. @HEAD LEVEL 2 =  Scaling and the Need for Hierarchy
  483.  
  484. Normally, primary clocks cannot be made available for all clients of a
  485. timekeeping system. Even if there were, some means would have to be
  486. provided to compare their indications, since in practice they are not
  487. completely trustworthy. Therefore, there will be a set of servers, at
  488. least one server for every primary clock, and each may serve multiple
  489. clients or other servers. If the number of clients or servers supported
  490. by a particular server exceeds its capacity or the capacity of its
  491. connected network, it may be necessary to create a multi-level, tree-
  492. structured, hierarchical system, with primary servers represented by the
  493. root(s) of the tree and clients represented by its leaves.
  494.  
  495. While the available PCS documentation does not address hierarchy issues,
  496. DTSS and NTP are both hierarchical systems. In its present form DTSS is
  497. limited to three levels of hierarchy: one corresponding to the local-
  498. server set, another to the global-server set and the third the clerk
  499. set. Each timekeeping entity is designated as either a server or a
  500. clerk, with synchronization always flowing from server to clerk.
  501.  
  502. NTP was developed in the context of the Internet and is blessed or
  503. cursed by its characteristics. Extrapolating from a recent survey in
  504. Noway, where some eight percent of about 5000 hosts responded to NTP
  505. messages, and a recent estimate of well over 100,000 hosts in the
  506. aggregate system, there are probably over 8,000 NTP-speaking hosts on
  507. the Internet. This does not count a sizeable number of NTP-capable hosts
  508. that do not participate continuously, but choose to read a server clock
  509. vicariously every few hours using designer protocols. The present
  510. Internet with well over 2,000 networks is hierarchically organized in
  511. levels from the NSFNET backbone, through about sixteen regional
  512. consortiums to about a thousand autonomously administered domains.
  513.  
  514. Therefore, NTP provides multiple levels of hierarchy, with each level
  515. identified by a number called the stratum. The stratum number and subnet
  516. topology are automatically determined as a function of timekeeping
  517. quality, with synchronization always flowing from the root to the
  518. leaves. The present NTP synchronization subnet routinely operates with
  519. five or more levels of hierarchy. However, it may happen that the subnet
  520. is reconfigured as the result of a broken or deteriorated primary clock
  521. or server, so that the stratum number direction of synchronization flow
  522. may at times be reversed between some servers.
  523.  
  524. @HEAD LEVEL 2 =  Configuration Strategies
  525.  
  526. Experience with NTP has proven that configuring a timekeeping system
  527. with a constantly changing topology, multiple levels of hierarchy and
  528. hundreds or thousands of servers and clients can be a daunting task.
  529. Carried to extreme, this could mean that every computer in the Internet
  530. must be made aware of at least three servers with which to synchronize.
  531. This issue is not addressed in the available PCS or NTP documentation
  532. other than to relegate it to the management functions.
  533.  
  534. In practice, NTP configuration relies on directory services (Domain Name
  535. System) augmented by informal databases. Server and client configuration
  536. consists of manually selecting a number of likely upstream servers,
  537. selecting a operating mode and building a configuration file. In most
  538. cases the upstream servers do not need to know about their downstream
  539. clients and the configuration files on a particular LAN are usually
  540. identical. In order to handle cases when a server is down, clients
  541. normally include more than three servers in this file and the protocol
  542. selects the best ones from among the set.
  543.  
  544. DTSS also relies on directory services; however, it also includes an
  545. elaborate server-discovery scheme based on periodically <169>enumerating
  546. the globals;<170> that is, querying the directory services to extract a
  547. list of available servers. The assumption is that DTSS requires no
  548. manual configuration at all, other than to set certain architectural
  549. constants which presumably are invariant over a management domain.
  550.  
  551. While not detracting from the DTSS scheme as a valuable management tool,
  552. it is not clear whether the particular enumeration scheme used by DTSS
  553. would be feasible in an environment such as the Internet with an
  554. estimated over 8,000 servers on over 2,000 networks operating in over
  555. 100 administrative domains. Presumably the directory information would
  556. have to be stratified in hierarchical levels or the information cached
  557. at strategic places. There is also an argument, as there also is in the
  558. case of cryptographic authentication, that these kinds of services
  559. should be management-based and available for use beyond timekeeping
  560. services. These are issues appropriate for further study.
  561.  
  562. @HEAD LEVEL 2 =  Synchronization Strategies
  563.  
  564. There are considerable differences between DTSS, PCS and NTP on the
  565. strategy for discovering servers and using them. As mentioned
  566. previously, DTSS discovers servers with the aid of directory services
  567. and an architected discovery protocol, while NTP relies on directory
  568. services and handcrafted configuration tables. The available PCS
  569. documentation does not discuss how to do this, but presumes some means
  570. is readily available. The principle difference between the timekeeping
  571. systems is the scheme used to select among the discovered servers and
  572. the strategy of their use.
  573.  
  574. In DTS a set of local servers is cached by the clerk. At intervals
  575. determined by the required accuracy and current confidence interval the
  576. client selects one of them at random and attempts to read its clock,
  577. which results in a new sample including time offset and confidence
  578. interval. The clerk stops at the first response and makes a new
  579. selection if a maximum number of attempts is reached. Operation
  580. continues in this way until a minimum number of servers have responded.
  581. If insufficient local servers have been found, the process continues
  582. with a set of global servers. The resulting sample set is then processed
  583. to obtain the final time offset and confidence interval. Note that only
  584. one reading from each server is obtained at each round; however, in the
  585. case of a time provider, multiple samples may be accumulated in order to
  586. assess the health of the device.
  587.  
  588. Like DTSS at intervals determined by the required accuracy and current
  589. confidence interval the PCS client attempts to read the clock of a
  590. predetermined server. At each round the attempts succeed if the
  591. confidence interval is less than a predetermined architectural constant
  592. and fails if a maximum number of attempts is reached. Extensions to the
  593. protocol provide for server failures in three ways. One called active
  594. master set is to send a multicast request to a number of redundant
  595. servers and save the first reply. Another called ranked master group
  596. requires each client to use a single default server unless directed
  597. otherwise by an unstated server-client protocol. The third called active
  598. master ring, in which multiple servers are arranged on a ring. At each
  599. round a client selects one of them at random. If attempts to synchronize
  600. fail, the client tries the next server on the ring and so on.
  601.  
  602. It is important to note that both DTSS and PCS <169>forget<170> all past
  603. history at each round. In effect, each round is statistically
  604. independent, with the only state memory the local clock and adjustment
  605. procedure. The only exception to this was noted with respect to the DTSS
  606. time-provider interface, where a history of samples is maintained for
  607. purposes of evaluating the health of the device. However, the NTP model
  608. specifically includes a limited amount of state history for the purposes
  609. of improving timing accuracy and error bounds.
  610.  
  611. One of the problems with systems that forget state at each round is that
  612. the time offset and error bound at each round can be quite different,
  613. depending on the particular statistics of the server selected at each
  614. round. A user of the service is then faced with the problem of how to
  615. interpret the differences and possibly to maintain a quality indicator
  616. based on memory of the reported confidence intervals themselves. In the
  617. case of PCS this variance can be reduced through judicious selection of
  618. the maximum error bound; however, this may result in an unacceptable
  619. rate of outages and searches for redundant servers.
  620.  
  621. On the other hand, NTP includes specific provisions to remember state in
  622. the form of the data filter shown in Figure 2. It has been
  623. experimentally verified that dramatic improvements in accuracy can be
  624. obtained using what in [MIL90b] is called a minimum filter. This device
  625. remembers the last several samples, including time offset and error
  626. bound, and selects the output sample with minimum error bound. The state
  627. information is maintained separately for each peer, since different
  628. peers can have markedly different statistics.
  629.  
  630. @HEAD LEVEL 2 =  Flexible Access
  631.  
  632. Although DTSS, PCS and NTP are designed to somewhat different models,
  633. they have a common goal of accurate, reliable service. In order to
  634. accomplish this goal, all three require exacting conformance to the
  635. specifications and possibly costly implementations. However, there may
  636. be cases where the cost to implement the full protocol is not justified
  637. with respect to the perceived requirements. In DTSS a hard line is drawn
  638. in that the protocol can operate in only one way and all clerks must
  639. implement the full suite of (clerk) protocol mechanisms. This issue is
  640. not addressed in the available documentation on PCS; however, several
  641. alternatives for slave-server access procedures are suggested.
  642.  
  643. In NTP it is possible for a client or sever to select among several
  644. modes of operation, including multicasting and client-server
  645. (synchronization flows only from server to client), and peer-peer
  646. (synchronization information flows either way, depending on timekeeping
  647. quality). It should be pointed out that some of these modes, especially
  648. the multicasting mode, where servers simply broadcast the time at
  649. designated intervals, do not enjoy all the advantages of the fully
  650. implemented protocol; however, it cases involving simple workstations
  651. and personal computers, they seem justified.
  652.  
  653. @HEAD LEVEL 2 =  Leap Seconds
  654.  
  655. A timekeeping system with profound reliability requirements and accuracy
  656. expectations of less than a second is always confronted with the issue
  657. of how to deal with leap seconds, which are introduced from time to time
  658. in the UTC timescale. There are many issues involved, some of which are
  659. addressed in [MIL90b], the issues come down to whether to allow the
  660. clocks of the timekeeping system to converge to a newly leaped timescale
  661. at their individual intrinsic rates, or to require that all clocks
  662. assume the new timescale at the instant of the leap. The former is the
  663. case with DTSS and, by impute, PCS. In DTSS the problem is solved simply
  664. by increasing the confidence interval at each server by one second just
  665. before the end of the UTC month.
  666.  
  667. The design approach taken in NTP was to require the accuracy expectation
  668. to be preserved always, including during, at and beyond the leap event.
  669. This has introduced a degree of complexity, since the protocol must
  670. provide for the advance distribution of leap-second warning, together
  671. with appropriate provisions in the local-clock algorithm. It is the
  672. expectation in the design that leap-second warnings are made available
  673. from the primary clocks as decreed by national standards bodies. While
  674. this expectation has been fulfilled in most time and frequency
  675. dissemination services in the U.S., it has not yet been fulfilled by
  676. all.
  677.  
  678. @HEAD LEVEL 1 =  References
  679.  
  680. @INDENT HEAD = [CCI90]
  681.  
  682. @INDENT =  Time Synchronization Service. CCITT Study Group VII Temporary
  683. Document 433, International Telephone and Telegraph Consultative
  684. Committee, February 1990.
  685.  
  686. @INDENT HEAD = [CRI89a]
  687.  
  688. @INDENT =  Cristian, F. Probabilistic clock synchronization. IBM Almaden
  689. Research Center Report RJ 6432 (62550), March 1989.
  690.  
  691. @INDENT HEAD = [CRI89b]
  692.  
  693. @INDENT =  Cristian, F. A probabilistic approach to distributed clock
  694. synchronization. Proc. Ninth IEEE International Conference on
  695. Distributed Computing Systems (June 1989), 288-296.
  696.  
  697. @INDENT HEAD = [DEC89]
  698.  
  699. @INDENT =  Digital Time Service Functional Specification Version
  700. T.1.0.5. Digital Equipment Corporation, 1989.
  701.  
  702. @INDENT HEAD = [ISO90]
  703.  
  704. @INDENT =  Overview of a Distributed Time Synchronization Service
  705. (DTSS). ISO Document ISO/IEC JTC 1/SC21 N4503, International Standards
  706. Organization, 1990.
  707.  
  708. @INDENT HEAD = [MIL89]
  709.  
  710. @INDENT =  Mills, D.L. Network Time Protocol (Version 2) specification
  711. and implementation. DARPA Network Working Group Report RFC-1119,
  712. University of Delaware, September 1989.
  713.  
  714. @INDENT HEAD = [MIL90a]
  715.  
  716. @INDENT =  Mills, D.L. On the accuracy and stability of clocks
  717. synchronized by the Network Time Protocol in the Internet system. ACM
  718. Computer Communication Review 20, 1 (January 1990), 65-75.
  719.  
  720. @INDENT HEAD = [MIL90b]
  721.  
  722. @INDENT =  Mills, D.L. Network Time Protocol (Version 3) specification,
  723. implementation and analysis. Electrical Engineering Department Report
  724. 90-6-1, University of Delaware, June 1990.
  725. @INDENT HEAD = [MIL90c]
  726.  
  727. @INDENT =  Mills, D.L. Internet time synchronization: the Network Time
  728. Protocol. IEEE Trans. Communications (to appear).
  729.  
  730. @HEAD LEVEL 1 =  Appendix. Requirements Statements
  731.  
  732. The following sections contain requirements statements excerpted from
  733. the specification documents.
  734.  
  735. @HEAD LEVEL 2 =  Distributed Time Synchronization Service (DTSS) [ISO90]
  736.  
  737. DTSS was designed to meet a number of significant technical goals to
  738. provide a firm underpinning for large, commercial networks. The design
  739. goals include the following:
  740.  
  741. @INDENT HEAD = 1.
  742.  
  743. @INDENT = Maximize the probability of a client obtaining the correct
  744. time.
  745.  
  746. @INDENT HEAD = 2.
  747.  
  748. @INDENT = Rely on specific measurement, rather than averages or
  749. experimentally determined parameters, to accommodate all network
  750. topologies with[out] operator intervention.
  751.  
  752. @INDENT HEAD = 3.
  753.  
  754. @INDENT = Use a client-server model to place complexity on the servers
  755. wherever possible. HEAD = 1.
  756.  
  757. @INDENT HEAD = 4.
  758.  
  759. @INDENT = Provide a simple and conventional view of time to consumers.
  760.  
  761. @INDENT HEAD = 5.
  762.  
  763. @INDENT = Associate a quality with every value of time. The quality can
  764. be expressed quantitatively as an inaccuracy measurement.
  765.  
  766. @INDENT HEAD = 6.
  767.  
  768. @INDENT = Be fault-tolerant; withstand the arbitrary failure of a small
  769. number of servers.
  770.  
  771. @INDENT HEAD = 7.
  772.  
  773. @INDENT = Scale from very small networks to networks of at least 105 to
  774. 106 real systems.
  775.  
  776. @INDENT HEAD = 8.
  777.  
  778. @INDENT = Be highly self-configuring to limit the amount of effort
  779. necessary to set up the service and keep it running.
  780.  
  781. @INDENT HEAD = 9.
  782.  
  783. @INDENT = Perform efficiently; do not use unreasonable amounts of
  784. resources.
  785.  
  786. @INDENT HEAD = 10.
  787.  
  788. @INDENT = Since time always advances, clocks too must always advance
  789. monotonically.
  790. @INDENT HEAD = 11.
  791.  
  792. @INDENT = Allow totally decentralized management to avoid the dis-
  793. economies of scale in attempting to manage all the resources in a large
  794. computer network from one control point.
  795.  
  796. @HEAD LEVEL 2 =  Network Time Protocol (NTP) [MIL90c]
  797.  
  798. Internet transmission paths can have wide variations in delay and
  799. reliability due to traffic load, route selection and facility outages.
  800. Stable frequency synchronization requires stable local-clock oscillators
  801. and multiple offset comparisons over relatively long periods of time,
  802. while reliable time synchronization requires carefully engineered
  803. selection algorithms and the use of redundant resources and diverse
  804. transmission paths. For instance, while only a few offset comparisons
  805. are usually adequate to determine local time in the Internet to within a
  806. few tens of milliseconds, dozens of measurements over some days are
  807. required to reliably stabilize frequency to a few milliseconds per day.
  808. Thus, the performance requirements of an internet-based time
  809. synchronization system are particularly demanding. A basic set of
  810. requirements must include the following:
  811.  
  812. @INDENT HEAD = 1.
  813.  
  814. @INDENT = The primary reference source(s) must be synchronized to
  815. national standards by wire, radio or calibrated atomic clock. The time
  816. servers must deliver continuous local time based on UTC, even when leap
  817. seconds are inserted in the UTC timescale.
  818.  
  819. @INDENT HEAD = 2.
  820.  
  821. @INDENT = The time servers must provide accurate and precise time, even
  822. with relatively large delay variations on the transmission paths. This
  823. requires careful design of the filtering and combining algorithms, as
  824. well as an extremely stable local-clock oscillator and synchronization
  825. mechanism.
  826.  
  827. @INDENT HEAD = 3.
  828.  
  829. @INDENT = The synchronization subnet must be reliable and survivable,
  830. even under unstable network conditions and where connectivity may be
  831. lost for periods up to days. This requires redundant time servers and
  832. diverse transmission paths, as well as a dynamically reconfigurable
  833. subnet architecture.
  834.  
  835. @INDENT HEAD = 4.
  836.  
  837. @INDENT = The synchronization protocol must operate continuously and
  838. provide update information at rates sufficient to compensate for the
  839. expected wander of the room-temperature quartz oscillators used in
  840. ordinary computer systems. It must operate efficiently with large
  841. numbers of time servers and clients in continuous-polled and procedure-
  842. call modes and in multicast and point-to-point configurations.
  843.  
  844. @INDENT HEAD = 5.
  845.  
  846. @INDENT = The system must operate in existing internets including a
  847. spectrum of machines ranging from personal workstations to
  848. supercomputers, but make minimal demands on the operating system and
  849. supporting services. Time-server software and especially client software
  850. must be easily installed and configured.
  851.  
  852. In addition to the above, and in common with other generic,
  853. promiscuously distributed services, the system must include protection
  854. against accidental or willful intrusion and provide a comprehensive
  855. interface for network management. [remaining text deleted]
  856.